package com.lge.clock.worldclock.map;

import com.lge.clock.worldclock.cities.CityInfoDisplay;

import android.content.Context;
import android.content.res.Configuration;
import android.opengl.GLSurfaceView;
import android.view.MotionEvent;

/**
 * @author lge.com
 */
public class EarthView extends GLSurfaceView{
	private EarthRenderer mRenderer;
	
	public EarthView(Context context) {
		super(context);
		mRenderer = new EarthRenderer(context, this);
		
		init(context);
	}
	
	/** Set the renderer associated with this view. Also starts the thread that will call the renderer,
	 *  which in turn causes the rendering to start. */
	public final void init(Context context) {
		setRenderer(mRenderer);
		setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
	}
	
	@Override 
	public boolean onTouchEvent(MotionEvent event) {
		return mRenderer.onTouchEvent(event);
	}
	
	@Override
	public void onResume() {
		super.onResume();
		mRenderer.onResume();
	}
	
	public void zoomInEarth() {
	    mRenderer.zoomInEarth(this);
	}
	
	public void zoomOutEarth() {
	    mRenderer.zoomOutEarth(this);
	}
	
    public CityInfoDisplay getDisplayCityInfo() {
    	return mRenderer.getDisplayCityInfo();
    }
	
    public float getcurrentzoomStatus()
    {
    	return mRenderer.getCurrentZoomStatus();
    }
}
